<?php

use yii\widgets\LinkPager;
use common\helpers\Url;
use common\helpers\Html;
use yii\widgets\ActiveForm;

$this->title = '用户银行卡管理';
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>

            </div>
            <div class="row">
                <div class="col-sm-10">
                    <?php $form = ActiveForm::begin([
                        'action' => Url::to(['index']),
                        'method' => 'get',
                    ]); ?>
                    <div class="col-sm-3">
                        <div class="input-group m-b">
                            <input type="text" class="form-control" name="bank_code" placeholder="银行卡号"
                                   value="<?= $bank_code ?>"/>
                            <span class="input-group-btn"><button class="btn btn-white"><i class="fa fa-search"></i> 搜索</button></span>
                        </div>
                    </div>
                    <?php ActiveForm::end(); ?>
                </div>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>用户名</th>
                        <th>开户名</th>
                        <th>开户行</th>
                        <th>银行卡号</th>
<!--                        <th>开户省份</th>-->
<!--                        <th>开户城市</th>-->
                        <th>支行名称</th>
                        <th>审核状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($models as $key => $model) { ?>
                        <tr id= <?= $model->id; ?>>
                            <td><?= $key + 1; ?></td>
                            <td><?= $model->member->username; ?></td>
                            <td><?= $model->rale_name; ?></td>
                            <td><?= $model->bank_name; ?></td>
                            <td><?= $model->bank_code; ?></td>
<!--                            <td>--><?//= $model->province; ?><!--</td>-->
<!--                            <td>--><?//= $model->city; ?><!--</td>-->
                            <td><?= $model->child_name; ?></td>
                            <td>
                                <?php
                                    if ($model->status == 1) {
                                        echo "待审核";
                                    }elseif ($model->status == 0){
                                        echo "驳回";
                                    }else{
                                        echo "通过审核";
                                    }
                                ?>
                            </td>
                            <td>
<!--                                --><?php //if ($model->status == '1'): ?>
<!--                                    --><?//= Html::a('通过', ['status', 'id' => $model->id, 'status' => '2'], [
//                                        'class' => 'btn btn-success btn-sm'
//                                    ]); ?>
<!---->
<!--                                    --><?//= Html::a('驳回', ['status', 'id' => $model->id, 'status' => '0'], [
//                                        'class' => 'btn btn-warning btn-sm'
//                                    ]); ?>
<!--                                --><?php //else: ?>
                                <?= Html::edit(['update-edit'], '编辑', [
                                    'data-toggle' => 'modal',
                                    'data-target' => '#ajaxModalLg',
                                ])?>
                                    <?= Html::delete(['delete', 'id' => $model->id]); ?>
<!--                                --><?php //endif; ?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">
                <?= LinkPager::widget([
                    'pagination' => $pages,
                ]); ?>
            </div>
        </div>
    </div>
</div>